// Copyright (c) 2016-2017, XMOS Ltd, All rights reserved
#ifndef _XMOS_BAIDU_CONTROL_H_
#define _XMOS_BAIDU_CONTROL_H_

#include <control.h>
#include "device_control_conf.h"

#define NUM_PARAMS_BAIDU 1

#define BAIDU_DOA_ANGLE	0


#define RESOURCE_ID_DOA 0x14
#define RESOURCE_ID_OTHER 0x15
#define DOA_VERSION_CMD 62

typedef enum {TYPE_FLOAT, TYPE_INT} param_type;
typedef enum {DOA, OTHER, BOTH} param_func;
typedef enum {DOA_MICARRAY=1} baidu_version;
typedef enum {READ, WRITE, READ_WRITE} param_rw;

typedef union int_float {
  int i;
  float f;
} int_float;

typedef struct cmdspec_t {
  param_func pfunc;
  char par_name[30];
  param_type type;
  unsigned offset;
  int_float max;
  int_float min;
  param_rw rw;
  char info[200];
} cmdspec_t;

#ifdef __XC__
/** Select function for controlling BAP parameters
 *
 *  \param i_control      Array of interfaces used to communicate with controllable entities
 */
select xmos_parameter_doa(server interface control i_control);
void Baidu_Control(server control_if ?i_control);

#endif /* __XC__ */

#endif /* _XMOS_BAIDU_CONTROL_H_ */
